/*
 * @Author: 李环玉 834654733@qq.com
 * @Date: 2023-12-16 02:42:22
 * @LastEditors: 李环玉 834654733@qq.com
 * @LastEditTime: 2024-01-07 05:12:33
 * @FilePath: \koa-server\src\router\admin.router.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

const Router = require('koa-router')
const { admin,loginAdmin,updateAdmin,resetPassWord,getAdminAll } = require('../controller/admin.controller')
const { adminValidator,verifyLogin,auth,cryptPassWord } = require("../middleware/admin.middleware")
const router = new Router({prefix:'/user'})
router.get('/admin',admin)
router.post('/admin/login',adminValidator,verifyLogin,loginAdmin)
router.post('/admin/update',updateAdmin)
router.post('/admin/updatepass',cryptPassWord,resetPassWord)
router.post('/admin/all',auth,getAdminAll)
module.exports = router